package myEnum;
/*
枚举是java中特殊的类型，常用于信息的标志和分类
 */
public class EnumTest {
    public static void main(String[] args) {
        method(Season.SPRING);
        System.out.println(Season.SPRING.ordinal());
    }
    public static void method(Season season) {
        switch (season){
            case SPRING:
                System.out.println("Spring");
                break;
            case SUMMER:
                System.out.println("Summer");
                break;
            case AUTUMN:
                System.out.println("Autumn");
                break;
            case WINTER:
                System.out.println("Winter");
                break;
        }

    }

}
enum Season{
    //枚举项：枚举类的对象，第一行必须是枚举项
    //可以定义成员变量，可以有抽象方法（一般不会用）
    SPRING,SUMMER,AUTUMN,WINTER;
}